class CreateCategories < ActiveRecord::Migration
  def self.up
    create_table :categories do |t|
      t.string :name
      t.integer :parent_id

      t.timestamps
    end

		alter_table :posts do |t|
			t.integer :category_id
		end
  end

  def self.down
    drop_table :categories
  	alter_table :posts do |t|
			remove_column :category_id
		end
	end

end
